

import ev = module("utils/commons/event");

/**
    * Event dispatched when an XML data file has been successfully loaded.
    * 
    * This class is normally used by the ecb.eu.util.net.XMLLoader class.
    * 
    * @author Xavier Sosnovsky, Anthony Morel
    * 
    * @see ecb.eu.util.net.XMLLoader
    */
export class XMLDataEvent extends ev.SDMXEvent {
    	
    /*==============================Fields================================*/
        
    /** The XML data that has been loaded */ 
    private _data:string;    
        
    /*=============================Constants==============================*/
        
    constructor(data:string, type:string) {
        super(type);
        this._data = data;
    }
    
    /*==========================Public methods============================*/
    
    /**
    * @inheritDoc
    */
    public clone(): XMLDataEvent {
        return new XMLDataEvent(this._data, this.getType());
    }
        
    /**
        * Returns the XML data extracted by a loader class
        * 
        * @return The XML data extracted by a loader class
        */
    public getData():string {
        return this._data;
    }
}